package com.dd.dus.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 描述: 服务端测试Feign 接口调用
 *
 * @author: yanglin
 * @Date: 2021-03-03-13:28
 * @Version: 1.0
 */
@Slf4j
// tags是对控制器命名，description可以对该控制器进行描述
@Api(tags = "测试相关Api")
@RestController
@RequestMapping("/")
public class TestController {

    @ApiOperation(value = "test查询接口")
    @GetMapping("test")
    public String queryTest(){
        log.info("欢迎你访问Feign服务端接口，queryTest");
        return "欢迎你访问Feign服务端接口，queryTest--"+UUID.randomUUID().toString();
    }

    @ApiOperation(value = "test查询接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name",paramType = "query",value = "名称",required = false,dataType = "String")
    })
    @GetMapping("test/{name}")
    public String queryTestStr(@PathVariable String name){
        log.info("欢迎你访问Feign服务端接口，queryTestStr");
        return "欢迎你访问Feign服务端接口，"+name+"--"+UUID.randomUUID().toString();
    }
}
